import java.util.*;
/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 09 - 26
 * Time: 20:48
 */
//牛客 统计回文
public class Solution7 {
    /*//我的方法
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String A = in.nextLine();
            String B = in.nextLine();
            int count = 0;
            StringBuilder stringBuilder1 = new StringBuilder();
            if(isReverse(stringBuilder1.append(B).append(A), 0, stringBuilder1.length() - 1)) {
                count++;
            }
            for(int i = 0; i < A.length(); i++) {
                StringBuilder stringBuilder = new StringBuilder();
                if(isReverse(stringBuilder.append(A, 0, i + 1).append(B).append(A, i + 1, A.length()), 0, stringBuilder.length() - 1)) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }
    static Boolean isReverse(StringBuilder stringBuilder, int start, int end) {
        while(start < end) {
            if(stringBuilder.charAt(start) == stringBuilder.charAt(end)) {
                start++;
                end--;
            }else {
                break;
            }
        }
        if(start < end) {
            return false;
        }
        return true;
    }*/




    //法二
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str1 = in.nextLine();
            String str2 = in.nextLine();
            int count = 0;
            for (int i = 0; i <= str1.length(); i++) {
                StringBuilder str = new StringBuilder(str1);//这一行要写到for循环里面
                str.insert(i, str2);
                StringBuilder temp = new StringBuilder(str);
                StringBuilder str3 = temp.reverse();
                if(str3.toString().equals(str.toString())) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }
}
